<?php

/**
 * Paquete form base class.
 *
 * @method Paquete getObject() Returns the current form's model object
 *
 * @package    courier
 * @subpackage form
 * @author     Your name here
 */
abstract class BasePaqueteForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'paq_id'          => new sfWidgetFormInputHidden(),
      'paq_peso'        => new sfWidgetFormInputText(),
      'paq_nombre'      => new sfWidgetFormInputText(),
      'paq_apellido'    => new sfWidgetFormInputText(),
      'paq_descripcion' => new sfWidgetFormInputText(),
      'paq_trackingnum' => new sfWidgetFormInputText(),
      'paq_solicitud'   => new sfWidgetFormPropelChoice(array('model' => 'Solicitud', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'paq_id'          => new sfValidatorChoice(array('choices' => array($this->getObject()->getPaqId()), 'empty_value' => $this->getObject()->getPaqId(), 'required' => false)),
      'paq_peso'        => new sfValidatorNumber(),
      'paq_nombre'      => new sfValidatorString(array('max_length' => 50)),
      'paq_apellido'    => new sfValidatorString(array('max_length' => 50)),
      'paq_descripcion' => new sfValidatorString(array('max_length' => 200)),
      'paq_trackingnum' => new sfValidatorString(array('max_length' => 50)),
      'paq_solicitud'   => new sfValidatorPropelChoice(array('model' => 'Solicitud', 'column' => 'sol_id')),
    ));

    $this->widgetSchema->setNameFormat('paquete[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Paquete';
  }


}
